import { ui } from "../../ui/layaMaxUI";
import GlobalEvent from "../../global/GlobalEvent";
import GameInfo from "../../model/GameInfo";
import { GameStatusEnum } from "../../model/Enums";
import GamePlay from "../../model/GamePlay";



export default class GamePlayView extends ui.scenes.GamePlay.GamePlayViewUI {
    constructor() {
        super();
    }


    public onEnable() {
        let mapCenterPoint = GamePlay.instance.mapCenterPoint
        GamePlay.instance.mapRadius = 500;
        this.graphics.drawCircle(mapCenterPoint.x, mapCenterPoint.y, GamePlay.instance.mapRadius, "#000", "#fff");

        GameInfo.instance.on('gameStatus', this, () => {
            if (GameInfo.instance.gameStatus === GameStatusEnum.GameOver) {
                this.removeSelf();
            }
        })
    }

    onDisable() {
        GameInfo.instance.offAllCaller(this);
    }


}